import Vuex from 'vuex'
import Vue from 'vue'
Vue.use(Vuex)
import myPlugin from './myPlugin'
const store = new Vuex.Store({
    state () {
        return {
            name: '张三',
            age: 20,
            address: '广州天河'
        }
    },
    mutations: {
        increment (state, age) {
            state.age = age
        }
    },
    plugins: [
        myPlugin({
            key: 'vuex-state',
            storage: localStorage,
            paths: ['age']
        })
    ]
})
export default store

